package com.zx.feign;

import com.zx.common.ResponseCommon;
import com.zx.vo.DeductGoodsInventory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Author:JasonZ
 * Data:2023/4/21
 */
/*不需要熔断的商品接口服务
* 当value也就是nacos服务出现了多次的时候 一定要指定一个contextId作为区分
* */
@FeignClient(value = "goods-service",contextId = "not-secured-goods")
public interface NotSecuredGoodsClient {
    /**
     * 根据商品id和购买数量 削减库存
     * @param goodsInventories
     * @return
     */
    @PostMapping("/goods-service/goods/deduct-goods-inventory")
    ResponseCommon<Boolean> deductGoodsInventory(@RequestBody List<DeductGoodsInventory> goodsInventories);
}
